package org.galaxyworld.flycode.core;

import org.galaxyworld.flycode.config.AppConfig;
import org.galaxyworld.flycode.dbspy.ModelTask;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@Component
public class JobExecutor {

    @Resource
    private AppConfig appConfig;


    @Resource
    private ModelTask modelTask;

    public void start() {
        // set shared variables
        Map<String, Object> shared = new HashMap<>();
        shared.put("java8", AppConfig.isJava8());
        TemplateManager.addSharedVariables(shared);

        // execute tasks
        modelTask.exec();
    }

}
